//
//  ClhTableViewTVCellStyle0.m
//  ListViewModel_Example
//
//  Created by 曹连华 on 2019/7/30.
//  Copyright © 2019 clh2046@163.com. All rights reserved.
//

#import "CLHTableViewTVCellStyle0.h"
#import "CLHTableViewTVCellStyle0RowModel.h"
#import <Masonry/Masonry.h>

@interface CLHTableViewTVCellStyle0 ()
@property (nonatomic, strong) UILabel *mainLabel;
@property (nonatomic, strong) UILabel *subLabel;
@end

@implementation CLHTableViewTVCellStyle0

- (UILabel *)mainLabel {
    if (!_mainLabel) {
        _mainLabel = [[UILabel alloc]init];
        _mainLabel.textColor = [UIColor brownColor];
        _mainLabel.font = [ UIFont systemFontOfSize:15];
        _mainLabel.numberOfLines = 0;
    }
    return _mainLabel;
}

- (UILabel *)subLabel {
    if (!_subLabel) {
        _subLabel = [[UILabel alloc]init];
        _subLabel.textColor = [UIColor darkGrayColor];
        _subLabel.font = [UIFont systemFontOfSize:11];
        _subLabel.numberOfLines = 0;
    }
    return _subLabel;
}

- (void)initUI {
    [super initUI];
    self.backgroundColor = [UIColor groupTableViewBackgroundColor];
    [self.contentView addSubview:self.mainLabel];
    [self.contentView addSubview:self.subLabel];
    [self.mainLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(10);
        make.top.mas_equalTo(5);
        make.width.mas_equalTo(60);
    }];
    
    [self.subLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(10);
        make.trailing.mas_equalTo(-10);
        make.top.mas_equalTo(self.mainLabel.mas_bottom).mas_equalTo(5);
        make.bottom.mas_equalTo(-5);
        
    }];
}
- (void)updateTVCCellWithRowModel:(CLHTableViewTVCellStyle0RowModel *)rowModel atIndexPath:(NSIndexPath *)indexPath {
    self.mainLabel.text = rowModel.mainTitle;
    self.subLabel.text = @"当前TVCell类名：CLHTableViewTVCellStyle0\nrowModel 类名：CLHTableViewTVCellStyle0RowModel";
}

@end
